<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		/*谷歌火狐浏览器居中 ,ie6中不居中ie7居中*/
		.box{width:100%;}
		.box .contBox{width:970px;height:500px;margin:0 auto;}
		/*ie居中*/
		/*.box{width:100%;text-align:center;}
		.box .contBox{width:970px;height:500px;text-align:left;}*/
		/*兼容ie和其他浏览器*/
		/*.box{width:100%;text-align:center;}
		.box .contBox{width:970px;height:500px;margin:0 auto;text-align:left;}*/
	</style>
</head>
<body>
	<div class="box">
		<div class="contBox"style="background-color:green;">
			<div style="background-color:red;width:400px;height:300px;">
				
			</div>
		</div>
	</div>
</body>
</html>